﻿using System;
using System.Collections.Generic;

namespace iTool.Common.CloudStateEntity
{

    /// <summary>
    /// 渠道服务
    /// </summary>
    public class ChannelServiceState
    {

        /// <summary>
        /// 在线服务器
        /// </summary>
        public List<string> Onlines { get; set; } = new List<string>();

        /// <summary>
        /// 订阅的主题
        /// </summary>
        public Topic Topic { get; set; } = new Topic();


        /// <summary>
        /// 渠道信息
        /// </summary>
        public string ChannelInfo { get; set; }

        /// <summary>
        /// 会话信息
        /// </summary>
        public string ChannelSession { get; set; }


        /// <summary>
        /// 会话列表
        /// （channel/sesstionInfo）
        /// </summary>
        public Dictionary<string, Sesstion> SesstionList { get; set; } = new Dictionary<string, Sesstion>();

        /// <summary>
        /// 最后接受时间
        /// </summary>
        //public DateTime LastReceiveTime { get; set; }
    }

    public class Topic
    {
        /// <summary>
        /// 订阅渠道
        /// </summary>
        public List<string> Subscribes { get; set; } = new List<string>();
    }

    public class Sesstion
    {
        /// <summary>
        /// 用户参数
        /// </summary>
        public string UserParameter { get; set; }

        /// <summary>
        /// 消息内容
        /// </summary>
        public string Message { get; set; }

        /// <summary>
        /// 是否是当前所在会话
        /// </summary>
        public bool IsIntoChannel { get; set; }

        /// <summary>
        /// 未读消息数量
        /// </summary>
        public int Count { get; set; }

        /// <summary>
        /// 接收消息时间
        /// </summary>
        public DateTime Time { get; set; }
    }
}
